package com.lucene.blog.db.mapper;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.lucene.blog.bean.Blog;

/**
 * 博客
 * @author yachao
 *
 */
public interface BlogMapper {
	// 获取博客信息，根据日期月份分组查询
	public List<Blog> getBlogData() throws SQLException;
	
	// 分页查询博客
	public List<Blog> getBlogListWithPaging(Map<String, Object> condition) throws SQLException;
	
	// 获取总记录数
	public long getBlogCount(Map<String, Object> condition) throws SQLException;
	
	// 根据id获取博客
	public Blog findBlogById(Integer blogId) throws SQLException;
	
	// 获取上一篇博客
	public Blog getPrevBlog(Integer blogId) throws SQLException;
	
	// 获取下一篇博客
	public Blog getNextBlog(Integer blogId) throws SQLException;
	
	// 根据博客类型的id查询该类型下的博客数量
	public int getBlogCountByTypeId(Integer blogTypeId) throws SQLException;
	
	// 添加博客
	public int addBlog(Blog blog) throws SQLException;
	
	// 更新博客信息
	public int updateBlog(Blog blog) throws SQLException;
	
	// 删除博客信息
	public int deleteBlog(Integer blogId) throws SQLException;
}
